<template>
  <div id="app">
    <navbar v-if="showNavbar"></navbar>
    <router-view/>
    <footer-component></footer-component>
  </div>
</template>

<script>
import { computed } from 'vue'
import { useRoute } from 'vue-router'
import Navbar from '@/components/Layout/Navbar.vue'
import Footer from '@/components/Layout/Footer.vue'

export default {
  name: 'App',
  components: {
    Navbar,
    'footer-component': Footer
  },
  setup() {
    const route = useRoute()
    
    const showNavbar = computed(() => {
      // 在登录和注册页面不显示导航栏
      return !['login', 'register'].includes(route.name)
    })
    
    return {
      showNavbar
    }
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.el-main {
  flex: 1;
  padding: 20px;
}
</style> 